#include "RssItem.h"
#include "RssDef.h"

RssItem::RssItem()
{
}

RssItem::~RssItem()
{
}

std::string& RssItem::operator[](const std::string &name)
{
    return m_name2value[name];
}

std::string RssItem::operator[](const std::string &name) const
{
    return getValue(name);
}

void RssItem::set(const std::string &name, const std::string &value)
{
    if(name == kPubDate)
	{
	    //...
	}
    m_name2value[name] = value;
}

std::string RssItem::getValue(const std::string &name) const
{
    std::map<std::string, std::string>::const_iterator it = m_name2value.find(name);
	if(it != m_name2value.end())
	{
	    return it->second;
	}
	return "";
}

inline time_t RssItem::getPubDate()
{
    return m_pubDate;
}

